<div class="fa prev-handler {{viewIndex<=0 ? 'invisibility' : '' }}" onclick="angular.element(this).scope().viewIndex<=0 ? '' : $('video').videoPause()" ng-click="prev()" style="visibility: visible;"></div>
<div class="fa next-handler {{viewIndex>=documentIds.length-1 ? 'invisibility' : ''}}" onclick="angular.element(this).scope().viewIndex>=angular.element(this).scope().documentIds.length-1 ? '' : $('video').videoPause()" ng-click="next()" style="visibility: visible;"></div>
<div class="previewer-content-image-wrapper">
    <div class="img-previewer" ng-show="documentView.mimeType=='image'">
        <div class="img-preview-toolbar" data-rotate="0">
            <div class="img-rotate" data-fn="left" ng-click="rotate==0 ? rotate=4 : return;rotate=rotate-1;" ><span class="fa fa-rotate-left"></span> <span>向左旋转</span></div>
            <div class="img-rotate" data-fn="right" ng-click="rotate==4 ? rotate=0 : return;rotate=rotate+1;"  ><span class="fa fa-rotate-right"></span> <span>向右旋转</span></div>
        </div>
        <div class="img-previewer-wrap">
            <div >
                 <span ng-show="documentView.mimeType=='image'">
                         <img class="{{'rotate'+rotate}}" ng-src="/suite/plugins/servlet/loadSource/{{documentView.id}}?version={{documentView.versionId}}&timestamp={{timestamp}}"/>
                 </span>
            </div>
        </div>
    </div>
    <div class="img-previewer" ng-show="documentView.mimeType=='file'">
        <div class="img-preview-toolbar" data-rotate="0">
            <div class="img-rotate" data-fn="left" ng-click="rotate==0 ? rotate=4 : return;rotate=rotate-1;" ><span class="fa fa-rotate-left"></span> <span>{{'document.left'|translate}}</span></div>
            <div class="img-rotate" data-fn="right" ng-click="rotate==4 ? rotate=0 : return;rotate=rotate+1;"  ><span class="fa fa-rotate-right"></span> <span>{{'document.right'|translate}}</span></div>
        </div>
        <div class="img-previewer-wrap">
            <div >
                <span ng-show="document.mimeType=='file'">
                       <span class="m-r-sm bg-primary document-icon">{{documentView.ext}}</span>
                       {{documentView.name}}.{{document.ext}}
                </span>
            </div>
        </div>
    </div>
    <div class="video-previewer" ng-show="documentView.mimeType=='video'">
        <div class="video-previewer-wrap">
            <video controls width="100%" height="100%" preload="auto" ng-src="{{'/suite/plugins/servlet/loadSource/'+documentView.id+'?version='+documentView.versionId+'&timestamp='+timestamp}}" >

            </video>
        </div>
    </div>
    <div class="pdf-previewer" ng-show="documentView.mimeType=='openOffice'">
        <iframe width="100%" height="10documentView.mimeType=='openOffice' ?0%" ng-hide="documentView.mimeType!='openOffice'" frameborder="0" ng-src="{{documentView.mimeType=='openOffice' ? '/suite/app/tpl/pdf/viewer.html?file=/suite/plugins/servlet/loadSource/'+documentView.id+'?version='+documentView.versionId+'&timestamp='+timestamp : ''}}"></iframe>
    </div>
    <div class="pdf-previewer" ng-show="documentView.mimeType=='report'">
        <iframe width="100%" height="100%" ng-hide="documentView.mimeType!='report'" frameborder="0" ng-src="{{documentView.mimeType=='report' ? '/suite/app/processtasks/report_detail.jsp?id='+documentView.id : ''}}"></iframe>
    </div>
    <div class="pdf-previewer" ng-show="documentView.mimeType=='preview'" style="background: #fff;" >
        <iframe width="100%" height="100%" ng-hide="documentView.mimeType!='preview'" frameborder="0" ng-src="{{documentView.mimeType=='preview' ? '/suite/plugins/servlet/loadSource/'+documentView.id+'?version='+documentView.versionId+'&timestamp='+timestamp : ''}}"></iframe>
    </div>
</div>
<div class="previewer-map map">
    <span>{{viewIndex+1}}</span>
    <span>/</span>
    <span>{{documentIds.length}}</span>
</div>
<div class="activities-container">
    <section class="detail-content scrollable thin-scroll">
        <div class="previewer-header-wrap">
            <div class="archived-wrapper"></div>
            <div class="previewer-header"><a class="menu-handler" ng-click="close()" data-gta="event"
                                             data-label="previewer menu"> <i
                    class="glyphicon glyphicon-remove icon-max"></i> <span
                    class="icon icon-chevron-down"></span> </a> <a class="modal-close cancel-handler icon icon-remove"
                                                                   data-dismiss="modal" data-gta="event"
                                                                   data-label="close previewer"></a>
                <div class="previewer-header-folder"><span class="previewer-header-folder-tips minor">{{'document.browse.folder'|translate}}</span> <a
                        class="enter-collection-handler hinted"> {{document.parentName}} </a></div>
                <div class="previewer-header-name">

                    <input type="text" ng-disabled="documentView.versionId!=-1||type=='preview'"
                           value="{{documentView.name}}" ng-model="documentView.name"
                           ng-blur="submitUpdateContentView(documentView.id,documentView.name,documentView.type,documentView.description)"
                           class="form-control ng-pristine ng-valid ng-touched">
                </div>

                <div class="previewer-header-size minor">
                    {{documentView.size}}
                    <a href ui-toggle-class style="font-size: 15px;display: inline;"
                       ng-click="setFavorite(document.id,document.favorite)"
                       class="m-xs {{document.favorite ? 'active' : ''}}">
                        <i class="fa fa-star text-warning text-active"></i>
                        <i class="fa fa-star-o  text" style="color:#98a6ad;"></i>
                    </a>
                    <a  ng-show="type=='preview'" ng-href="/suite/plugins/servlet/loadSource/{{documentView.id}}?version={{documentView.versionId}}&isDowload=true" class="text-info" >
                        {{'document.browse.dowload'|translate}}
                    </a>
                </div>
            </div>
        </div>

        <div class="previewer-handler-wrap detail-white-card" ng-show="type=='operation'" style="display: block;">
            <div class="previewer-handler-set">
                <a ui-sref="app.news({docId:document.id,userId:'-1'})" ng-click="close();" >
                    <span class="icon iconfont icon-icon2"></span> {{'document.browse.share'|translate}}
                </a>
                <a ng-click="pooledDocument(document.id,document.name,document.type)" >
                    <span class="icon iconfont icon-gongxiang"></span> {{'document.browse.pooled'|translate}}
                </a>
                <a ng-href="/suite/plugins/servlet/loadSource/{{documentView.id}}?version={{documentView.versionId}}&isDowload=true">
                    <span class="icon icon-cloud-download"></span> {{'document.browse.dowload'|translate}}
                </a>
                <a ng-show="documentView.versionId==-1" ng-show="document.creator==userInfo.userName"
                   ng-click="moveDocument(document.id,document.name,document.type)">
                    <span class="icon iconfont icon-yidongdao-copy"></span> {{'document.browse.move'|translate}}
                </a>

                <a ng-show="documentView.versionId==-1" ng-show="document.creator==userInfo.userName" ng-click="deleteDocument(document.id)" >
                    <span class="icon fa fa-trash-o"></span> {{'document.browse.delete'|translate}}
                </a>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="previewer-versions-wrap detail-white-card">
            <div class="work-version-view">
                <div class="work-versions-title">{{'document.browse.historicalVersion'|translate}}

                    <form id="attachUploadNewVersionForm" ng-show="type=='operation'" style="display: inline;"
                          action="/suite/plugins/servlet/uploadDocument" method="post"
                          enctype="multipart/form-data" target="ifm">
                        <input type="hidden" id="fileId" name="fileId" value="{{document.id}}">
                        <a href="javascript:;" style="line-height: 0px;padding: 0px;margin: 0"
                           class="a-i-upload text-info btn-a m-r-sm pull-right">

                            <input id="attachUploadNewVersion" name="uploadDocumentFile" type="file" flag="0"
                                   onchange="angular.element(this).scope().selectedFileNewVersion(this)"
                                   style="width:206px;">
                            <i class="icon-cloud-upload"></i> <span>{{'document.browse.uploadNewVersion'|translate}}</span>
                        </a>
                    </form>
                </div>
                <ul class="work-versions-list">
                    <li ng-click="!version.selected ? versionSelect(version.index) : return;"
                        class="work-version work-version-current {{version.selected ? ' on-selecting ' :'' }}"
                        ng-repeat="version in document.versions">
                        <div class="work-version-content {{version.selected ? 'text-info' : ''}}">
                            <i class="fa {{version.selected ? 'fa-dot-circle-o' : 'fa-circle-o'}} ">&nbsp;&nbsp;
                                v{{version.versionId==-1 ? document.versions.length : version.versionId}}.
                                <span ng-bind-html="version.name+'.'+version.ext | limitTo:15"></span> </i>
                            <span class="pull-right">{{version.dateCreated}}</span>
                        </div>

                    </li>
                </ul>
            </div>
        </div>
        <div class="previewer-infos-wrap">
            <div class="detail-infos-view">
                <div class="detail-infos-link-view on-top">
                    <div class="link-add-wrap child-tree" >
                        <span class="">{{'document.browse.description'|translate}} : <textarea class="form-control"  ng-focus="isEditDescription=true;"  ng-disabled="documentView.versionId!=-1||type=='preview'"
                                                                                               ng-model="documentView.description"
                                                                                               style="border: 0;background: none;width: 100%;height: 55px;padding: 0px;font-size: 13px;">{{documentView.description}}</textarea></span>
                        <div class="buttons" ng-show="isEditDescription">
                            <a class="btn btn-link" ng-click="isEditDescription=false;" >{{'common.cancel'|translate}}</a>
                            <a class="btn btn-info" ng-click="submitUpdateContentView(documentView.id,documentView.name,documentView.type,documentView.description);isEditDescription=false;" >{{'common.ok'|translate}}</a>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </section>
</div>